﻿using System;
using System.Globalization;
using System.Text;
using System.Windows.Data;

namespace MainApp.Utils
{
    public class TextPasswordCharConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string str)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var c in str)
                {
                    sb.Append($"*");
                }
                return sb.ToString();
            }
            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
